#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2018, Niklas Hauser
#
# This file is part of the modm project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# -----------------------------------------------------------------------------

def init(module):
    module.name = ":math:utils"
    module.description = "Utilities"

def prepare(module, options):
    module.depends(":architecture")
    return True

def build(env):
    env.outbasepath = "modm/src/modm/math/utils"

    ignore = ["*operator_*"]
    if "avr" in env[":target"].identifier["platform"]:
        ignore.append("*pc*")
        env.copy("operator_avr_impl.hpp", "operator_impl.hpp")
    else:
        ignore.append("*avr*")
        env.copy("operator_impl.hpp")

    env.copy('.', ignore=env.ignore_paths(*ignore))
    env.copy("../utils.hpp")
